package cn.wolfcode.crm.shiro;

import com.jagregory.shiro.freemarker.ShiroTags;
import freemarker.template.TemplateException;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

import java.io.IOException;

public class ShiroTagMarkerConfigurer extends FreeMarkerConfigurer {
    //因为我们需要添加一个标签,用来回显用户名和不显示用没有权限的按钮
    @Override
    public void afterPropertiesSet() throws IOException, TemplateException {
        super.afterPropertiesSet();
        this.getConfiguration().setSharedVariable("shiro",new ShiroTags());
    }
}
